Core.Test.registerTest({
	group: "utils",
	name: "Array",
	
	"Should produce shallow copy of the array": function() {
		var arr = [1,2,3,"aa",4],
			copy = arr.clone();
		
		Assert.no(arr === copy);
		Assert.equal(arr, copy);
	},
	
	"Should contain existing elements": function() {
		var arr = [1,2,3,"aa",4,"bb"];
		
		Assert.yes(arr.contains(1));
		Assert.yes(arr.contains(2));
		Assert.yes(arr.contains("aa"));
		Assert.yes(arr.contains("bb"));
	},
	
	"Shouldn't contain unexisting elements": function() {
		var arr = [1,2,3,"aa",4,"bb"];
		
		Assert.no(arr.contains(5));
		Assert.no(arr.contains("cc"));
	},
	
	"Should be empty if contains no elements": function() {
		Assert.yes([].empty());
		Assert.no(["aa"].empty());
	},
	
	"Should return the last element of the array": function() {
		Assert.equal(5, [1,2,3,5].last());
		Assert.equal("cc", ["aa","bb","cc"].last());
	},
	
	"Should remove element from the array": function() {
		Assert.equal([1,2,4], [1,2,3,4].erase(3));
		Assert.equal(["aa","bb"], ["aa","bb","cc"].erase("cc"));
		Assert.equal(["aa", "bb"], ["aa","bb"].erase("dd"));
	},
	
	"Should remove all elements equals to the given one": function() {
		Assert.equal([], [1,1,1,1,1,1].erase(1));
		Assert.equal(["bb"], ["aa", "bb", "aa"].erase("aa"));
	}
});